//package com.gpoint.rdp.door.PrivilegeOfPrivilegeType.controller;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.servlet.ModelAndView;
//
//import com.gpoint.rdp.base.core.util.string.StringUtil;
//import com.gpoint.rdp.base.core.entity.ResultMessage;
//import com.gpoint.rdp.base.framework.page.PageList;
//import com.gpoint.rdp.base.framework.page.PageResult;
//import com.gpoint.rdp.api.base.query.QueryFilter;
//import com.gpoint.rdp.base.web.controller.GenericController;
//import com.gpoint.rdp.base.web.json.PageJson;
//import com.gpoint.rdp.base.web.util.RequestUtil;
//import com.gpoint.rdp.door.PrivilegeOfPrivilegeType.service.PrivilegeOfPrivilegeTypeService;
//import com.gpoint.rdp.door.PrivilegeOfPrivilegeType.service.PrivilegeOfPrivilegeTypeQueryService;
//import com.gpoint.rdp.door.PrivilegeOfPrivilegeType.persistence.dao.PrivilegeOfPrivilegeTypeDao;
//import com.gpoint.rdp.door.PrivilegeOfPrivilegeType.persistence.dao.PrivilegeOfPrivilegeTypeQueryDao;
//import com.gpoint.rdp.door.PrivilegeOfPrivilegeType.persistence.entity.PrivilegeOfPrivilegeTypePo;
//import com.gpoint.rdp.base.core.util.JacksonUtil;
//
//import java.util.List;
//
///**
// * TB_DOOR_PRIVILEGEPRIVILEGETYPE 控制类
// *
// *<pre> 
// * 开发公司：苏州东大金点信息技术有限公司
// * 开发人员：唐红锋
// * 邮箱地址：55872655@qq.com
// * 创建时间：2019-09-29 18:53:11
// *</pre>
// */
//@Controller
//@RequestMapping("/rdp/PrivilegeOfPrivilegeType/privilegeOfPrivilegeType/")
//public class PrivilegeOfPrivilegeTypeController extends GenericController{
//	@Resource
//	private PrivilegeOfPrivilegeTypeService privilegeOfPrivilegeTypeService;
//	@Resource
//	private PrivilegeOfPrivilegeTypeQueryService privilegeOfPrivilegeTypeQueryService;
//	
//	
//	@Resource
//	private  PrivilegeOfPrivilegeTypeDao privilegeOfPrivilegeTypeQDao;
//	
//	
//	/**
//	 * 【TB_DOOR_PRIVILEGEPRIVILEGETYPE】列表(分页条件查询)数据
//	 *
//	 * @param request
//	 * @param reponse
//	 * @return
//	 * @throws Exception
//	 */
//	@RequestMapping("listJson")
//	public @ResponseBody PageJson listJson(HttpServletRequest request,HttpServletResponse reponse) throws Exception{
//		QueryFilter queryFilter = getQuerFilter(request);
//		try{
//			String listData = privilegeOfPrivilegeTypeQueryService.query(queryFilter);
//			PageList<PrivilegeOfPrivilegeTypePo> privilegeOfPrivilegeTypeList = null;
//			if(JacksonUtil.isJsonObject(listData)){
//				List<PrivilegeOfPrivilegeTypePo> list = PrivilegeOfPrivilegeTypePo.fromJsonArrayString(JacksonUtil.getString(listData, "data"));
//				PageResult pageResult = PageResult.fromJson(JacksonUtil.getString(listData, "pageResult"));
//				privilegeOfPrivilegeTypeList = new PageList<PrivilegeOfPrivilegeTypePo>(list, pageResult);
//			}
//			
//			return new PageJson(privilegeOfPrivilegeTypeList);
//		} catch (Exception e) {
//			logger.error(e.getMessage(), e);
//			return new PageJson();
//		}
//	}
//	
//	@RequestMapping("list")
//	 public ModelAndView list(HttpServletRequest request,HttpServletResponse response) throws Exception{
//	  ModelAndView mv=getAutoView();
//	  return mv;
//	  
//	 }
//	
//	
//	
//	/**
//	 * 编辑【TB_DOOR_PRIVILEGEPRIVILEGETYPE】信息页面
//	 *
//	 * @param request
//	 * @param response
//	 * @return
//	 * @throws Exception
//	 */
//	@RequestMapping("edit")
//	public ModelAndView edit(HttpServletRequest request,HttpServletResponse response) throws Exception{
//		String preUrl= RequestUtil.getPrePage(request);
//		String privilegerecid=RequestUtil.getString(request, "privilegerecid");
//		PrivilegeOfPrivilegeTypePo privilegeOfPrivilegeType=null;
//		if(StringUtil.isNotEmpty(privilegerecid)){
//			String data = null;
//			data = privilegeOfPrivilegeTypeQueryService.get(privilegerecid);
//			privilegeOfPrivilegeType = PrivilegeOfPrivilegeTypePo.fromJsonString(data);
//		}
//
//		return getAutoView().addObject("privilegeOfPrivilegeType", privilegeOfPrivilegeType).addObject("returnUrl", preUrl);
//	}
//	
//	/**
//	 * 编辑【TB_DOOR_PRIVILEGEPRIVILEGETYPE】信息页面
//	 *
//	 * @param request
//	 * @param response
//	 * @return
//	 * @throws Exception
//	 */
//	@RequestMapping("flowEdit")
//	public ModelAndView flowEdit(HttpServletRequest request,HttpServletResponse response) throws Exception{
//		String preUrl= RequestUtil.getPrePage(request);
//		String privilegerecid=RequestUtil.getString(request, "privilegerecid");
//		PrivilegeOfPrivilegeTypePo privilegeOfPrivilegeType=null;
//		if(StringUtil.isNotEmpty(privilegerecid)){
//			String data = null;
//			data = privilegeOfPrivilegeTypeQueryService.get(privilegerecid);
//			privilegeOfPrivilegeType = PrivilegeOfPrivilegeTypePo.fromJsonString(data);
//		}
//		return getAutoView().addObject("privilegeOfPrivilegeType", privilegeOfPrivilegeType).addObject("returnUrl", preUrl);
//	}
//	
//	/**
//	 * 【TB_DOOR_PRIVILEGEPRIVILEGETYPE】明细页面
//	 *
//	 * @param request
//	 * @param response
//	 * @return
//	 * @throws Exception
//	 */
//	@RequestMapping("get")
//	public ModelAndView get(HttpServletRequest request,HttpServletResponse response) throws Exception{
//		String preUrl= RequestUtil.getPrePage(request);
//		String privilegerecid=RequestUtil.getString(request, "privilegerecid");
//		PrivilegeOfPrivilegeTypePo privilegeOfPrivilegeType=null;
//		if(StringUtil.isNotEmpty(privilegerecid)){
//			String data = null;
//			data = privilegeOfPrivilegeTypeQueryService.get(privilegerecid);
//			privilegeOfPrivilegeType = PrivilegeOfPrivilegeTypePo.fromJsonString(data);
//		}
//		return getAutoView().addObject("privilegeOfPrivilegeType", privilegeOfPrivilegeType).addObject("returnUrl", preUrl);
//	}
//	
//	/** 
//	 * 保存【TB_DOOR_PRIVILEGEPRIVILEGETYPE】信息
//	 *
//	 * @param request
//	 * @param response
//	 * @param  privilegeOfPrivilegeType
//	 * @throws Exception
//	 */
//	@RequestMapping("savebatch")
//	public void savebatch(@RequestBody String json,HttpServletRequest request,HttpServletResponse response) throws Exception{
//		ResultMessage message=null;
//		try {
//			
//			if(json.contains("[")) {
//				String quStr=json.substring(json.indexOf("[")+1,json.indexOf("]"));
//				String str = StringUtils.strip(quStr, "[]");
//				String liststr= null;
//				   String[] sArray = str.split(",");
//				   for (int i = 0; i < sArray.length; i++) {
//					     liststr = str.split(",")[i];
//					  
//					String jsonlist=json.replaceAll("(\\[[^\\]]*\\])", liststr);
//					privilegeOfPrivilegeTypeService.save(jsonlist);
//				}
//			}
//			
//			
//			message=new ResultMessage(ResultMessage.SUCCESS, "保存TB_DOOR_PRIVILEGEPRIVILEGETYPE成功");
//		} catch (Exception e) {
//			message=new ResultMessage(ResultMessage.FAIL, "对TB_DOOR_PRIVILEGEPRIVILEGETYPE操作失败,"+e.getMessage());
//			logger.error("对TB_DOOR_PRIVILEGEPRIVILEGETYPE操作失败，" + e.getMessage(),e);
//		}
//		writeResultMessage(response.getWriter(), message);
//	}
//	
//	
//	/** 
//	 * 保存【TB_DOOR_PRIVILEGEPRIVILEGETYPE】信息
//	 *
//	 * @param request
//	 * @param response
//	 * @param  privilegeOfPrivilegeType
//	 * @throws Exception
//	 */
//	@RequestMapping("save")
//	public void save(@RequestBody String json,HttpServletRequest request,HttpServletResponse response) throws Exception{
//		ResultMessage message=null;
//		try {
//			privilegeOfPrivilegeTypeService.save(json);
//			message=new ResultMessage(ResultMessage.SUCCESS, "保存TB_DOOR_PRIVILEGEPRIVILEGETYPE成功");
//		} catch (Exception e) {
//			message=new ResultMessage(ResultMessage.FAIL, "对TB_DOOR_PRIVILEGEPRIVILEGETYPE操作失败,"+e.getMessage());
//			logger.error("对TB_DOOR_PRIVILEGEPRIVILEGETYPE操作失败，" + e.getMessage(),e);
//		}
//		writeResultMessage(response.getWriter(), message);
//	}
//	
//	
//	@RequestMapping("save2")
//	public void save2(HttpServletRequest request,HttpServletResponse response) throws Exception{
//		ResultMessage message=null;
//		try {
//			String json = RequestUtil.getString(request, "json");
//			privilegeOfPrivilegeTypeService.save(json);
//			message=new ResultMessage(ResultMessage.SUCCESS, "保存TB_DOOR_PRIVILEGEPRIVILEGETYPE成功");
//		} catch (Exception e) {
//			message=new ResultMessage(ResultMessage.FAIL, "对TB_DOOR_PRIVILEGEPRIVILEGETYPE操作失败,"+e.getMessage());
//			logger.error("对TB_DOOR_PRIVILEGEPRIVILEGETYPE操作失败，" + e.getMessage(),e);
//		}
//		writeResultMessage(response.getWriter(), message);
//	}
//	
//	/**
//	 *  批量删除【TB_DOOR_PRIVILEGEPRIVILEGETYPE】记录
//	 *
//	 * @param request
//	 * @param response
//	 * @throws Exception
//	 */
//	@RequestMapping("remove")
//	public void remove(HttpServletRequest request,HttpServletResponse response) throws Exception{
//		ResultMessage message=null;
//		try {
//			//获得待删除的id
//			String[] ids=RequestUtil.getStringAryByStr(request, "privilegerecid");
//			privilegeOfPrivilegeTypeService.deleteByIds(ids);
//			message=new ResultMessage(ResultMessage.SUCCESS, "删除TB_DOOR_PRIVILEGEPRIVILEGETYPE成功");
//		} catch (Exception e) {
//			message=new ResultMessage(ResultMessage.FAIL, "删除TB_DOOR_PRIVILEGEPRIVILEGETYPE失败，" + e.getMessage());
//			logger.error("删除TB_DOOR_PRIVILEGEPRIVILEGETYPE失败，" + e.getMessage(),e);
//		}
//		writeResultMessage(response.getWriter(), message);
//	}
//	
//	
//	
//	
//	/**
//	 * 更改删除需要更改daomap.xml 文件
//	 * @param request
//	 * @param response
//	 * @throws Exception
//	 */
//	@RequestMapping("removebycardnum")
//	public void removebycardnum(HttpServletRequest request,HttpServletResponse response) throws Exception{
//		ResultMessage message=null;
//		try {
//			//获得待删除的id
//			 String str = request.getParameter("consumerid");
//			privilegeOfPrivilegeTypeQDao.deleteByKey("remove1", str);
//			message=new ResultMessage(ResultMessage.SUCCESS, "删除TB_DOOR_PRIVILEGEPRIVILEGETYPE成功");
//		} catch (Exception e) {
//			message=new ResultMessage(ResultMessage.FAIL, "删除TB_DOOR_PRIVILEGEPRIVILEGETYPE失败，" + e.getMessage());
//			logger.error("删除TB_DOOR_PRIVILEGEPRIVILEGETYPE失败，" + e.getMessage(),e);
//		}
//		writeResultMessage(response.getWriter(), message);
//	}
//
//
//	
//	
//	
//	
//	
//
//}